-
Notifications
You must be signed in to change notification settings - Fork 15
Add PKCE parameters to relevant OAuth methods #536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PKCE parameters to relevant OAuth methods #536
Conversation
This adds parameters necessary for PKCE (Proof Key for Code Exchange) during OAuth authorization flow (see https://docs.joinmastodon.org/spec/oauth/#pkce). Specifically: - adds parameters state, codeChallenge, codeChallengeMethod to getOAuthUrl() - adds parameter codeVerifier to getUserAccessTokenWithAuthorizationCodeGrant() - same for Rx methods - modifies Kotlin+Java samples to make use of these parameters Closes PattaFeuFeu#531.
Note regarding the changed parameter order mentioned as a breaking change: I could have added the new parameter to the end, but expect PKCE to eventually become mandatory (or at least best practice), so that a non-null |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #536 +/- ##
============================================
- Coverage 49.99% 48.30% -1.69%
- Complexity 774 819 +45
============================================
Files 176 183 +7
Lines 5107 5370 +263
Branches 327 289 -38
============================================
+ Hits 2553 2594 +41
- Misses 2275 2600 +325
+ Partials 279 176 -103
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven’t tested this myself but trust your checks using the samples.
New parameter order is not ideal for Java users but as long as we’re in non-stable SNAPSHOT mode, that’s fine by me.
Description
This adds parameters necessary for PKCE (Proof Key for Code Exchange) during OAuth authorization flow (see https://docs.joinmastodon.org/spec/oauth/#pkce). Specifically:
Closes #531.
Type of Change
Breaking Changes
getUserAccessTokenWithAuthorizationCodeGrant()
. Java users of the library will need to add anull
parameter (ascodeVerifier
) before a non-nullscope
parameter if not using PKCE.How Has This Been Tested?
See below. Also ran modified samples against live Mastodon servers to confirm that PKCE parameters are used and correct.
Mandatory Checklist
gradle check
and there were no errors reportedUnit tests not possible, but samples do work.
Optional checks
/docs
folder (e.g. API Coverage page)?Documentation was not yet changed back from "fully supported".